<?php

namespace App\ModelFilters;

use EloquentFilter\ModelFilter;

class Qh_QuestionFilter extends ModelFilter
{
    /**
    * Related Models that have ModelFilters as well as the method on the ModelFilter
    * As [relationMethod => [input_key1, input_key2]].
    *
    * @var array
    */
    public $relations = [];

    public function knowledgeId($v) {
        return $this->whereIn('knowledgeId', array_filter(explode(',', $v)));
    }

    public function id($v) {
        return $this->where('id', $v);
    }

    public function title($v) {
        return $this->where('title', 'like', '%'.$v.'%');
    }
}
